<?php 

require_once("../include/conn.php");


$title=trim($_REQUEST["title"]);
$pic=trim($_REQUEST["pic"]);
$url=trim($_REQUEST["url"]);

if($pic!="" && $title!="" && $url!="" )	{
	
		if($_REQUEST["action"] == "update")
		{	
			
				if(!empty($_REQUEST["id"]))
				{
			
					$id=$_REQUEST["id"];
					$sql_dz="UPDATE `$tb_mv` SET ";
					
					$sql_dz.=" `title` = '$title',`pic` = '$pic',`url` = '$url'";				
					
					$sql_dz.=" WHERE `id` = '$id'";
					
					//echo $sql_dz;
					$cn_dz = mysql_db_query($db_name,$sql_dz); 
					
				
				}else{
		
				
				?>
				<meta http-equiv="refresh" content="0;URL=admin_index.php">
				<?php 
		
				}
		
		}
		?>
		<script language="JavaScript" type="text/JavaScript">
		alert("操作已成功!");
		</script>  
		<meta http-equiv="refresh" content="0;URL=move_mange.php">
		<?	
		 
		 
}
else{
	echo ("<script type='text/javascript'> alert('填写资料不完整！');history.go(-1);</script>");
}

?>